package com.itheima.boottlias.mapper;

import com.github.pagehelper.Page;
import com.itheima.boottlias.domain.entity.NameNum;
import com.itheima.boottlias.domain.entity.NameValue;
import com.itheima.boottlias.domain.pojo.Student;
import com.itheima.boottlias.domain.query.QueryParam;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author ghy
 * @version 1.0
 * @since 2025-07-15 10:48
 */
@Mapper
public interface StudentMapper {

    Long countByClazzId(Integer clazzId);

    Page<Student> findByCondition(QueryParam queryParam);

    void insert(Student student);

    void deleteByIds(@Param("ids") Integer[] ids);

    Student findByIdAndClassName(Integer id);

    void update(Student student);

    void updateViolationCountAndScore(@Param("id") Integer id,
                                      @Param("score") Short score);

    List<NameValue> getStudentDegreeData();

    List<NameNum> getStudentCountData();
}
